using System;
using System.Collections.Generic;
using System.Text;
using CommonLib.Properties;
using System.IO;

namespace CommonLib
{
    public class BatFactory
    {
        static public string CreateConvertBat(string input, string output, long fs, int offset,
            int vb, int ab, int ac, int vol, int fps, int mode)
        {
            string[] bat = new string[]
            {
                "SET INPUT=\""  + input + "\"",
                "SET OUTPUT=\"" + output + "\"",
                "SET OFFSET="   + offset,
                "SET VB="       + vb,
                "SET AB="       + ab,
                "SET AC="       + ac,
                "SET VOL="      + vol,
                "SET FPS="      + fps,
                "SET FS="       + fs,
                "SET MODE="     + mode,
                "SET TIME=\""   + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + "\"",
                "SET CORES=\""  + Settings.Default.CoresPath + "\"",
                Resources.Convert,
            };
            string file = Path.Combine(PathConf.tdir, "Tmp.bat");
            File.WriteAllLines(file, bat);

            return file;
        }

        static public string CreateGetDurationBat(string input)
        {
            string[] bat = new string[]
            {
                "SET INPUT=\""    + input + "\"",
                "SET CORES=\""    + Settings.Default.CoresPath + "\"",
                Resources.GetDuration,
            };
            string file = Path.Combine(PathConf.tdir, "Tmp.bat");
            File.WriteAllLines(file, bat);

            return file;
        }
    }
}
